﻿using System.Collections;
using System.Collections.Generic;
using GameFramework;
using GameFramework.Procedure;
using UnityEngine;
using UnityGameFramework.Runtime;
using ProcedureOwner = GameFramework.Fsm.IFsm<GameFramework.Procedure.IProcedureManager>;

public class ProcedureLaunch : ProcedureBase
{

    protected override void OnEnter(GameFramework.Fsm.IFsm<IProcedureManager> procedureOwner)
    {
        base.OnEnter(procedureOwner);
        //TODO.....初始化逻辑   资源加载  语言包  声音配置  画质
        Log.Info("第" + Random.Range(1, 22) + "位同学请回答");
        //加载表数据
        SerializableSet ser = Resources.Load<SerializableSet>("SerializableSet");
        Deserializer.Deserialize(ser);
        Resources.UnloadUnusedAssets();




        //加载场景
        SceneComponent scene = UnityGameFramework.Runtime.GameEntry.GetComponent<SceneComponent>();
        scene.LoadScene("Login", this);//把场景名称传递进来



        //切换流程
        ChangeState<ProcedureLogin>(procedureOwner);
    }

    protected override void OnUpdate(GameFramework.Fsm.IFsm<IProcedureManager> procedureOwner, float elapseSeconds, float realElapseSeconds)
    {
        base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds);
        //ChangeState<>
    }


}
